<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- onclick 监听点击事件，调用openNewWin函数 -->
    <button onclick="openNewWin()">打开窗口</button>
    <script>
        function openNewWin() {
            // window.open打开一个新的窗口
            window.open("http://www.baidu.com");
        }
    </script>
</body>

</html>